diff --git a/xarray/core/variable.py b/xarray/core/variable.py
index 17ecdf62..b1b6df8e 100644
--- a/xarray/core/variable.py
+++ b/xarray/core/variable.py
@@ -1738,8 +1738,15 @@ class Variable(
             dim = [dim]
 
         def _wrapper(npa, **kwargs):
-            # move quantile axis to end. required for apply_ufunc
-            return np.moveaxis(np.nanpercentile(npa, **kwargs), 0, -1)
+            try:
+                # move quantile axis to end. required for apply_ufunc
+                return np.moveaxis(np.nanpercentile(npa, **kwargs), 0, -1)
+            except ValueError as e:
+                # Check if the error message is about the percentile range
+                if 'Percentiles must be in the range [0, 100]' in str(e):
+                    raise ValueError("Quantiles must be in the range [0, 1]") from e
+                else:
+                    raise
 
         axis = np.arange(-1, -1 * len(dim) - 1, -1)
         result = apply_ufunc(
